home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14839 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  922 b 

  1. Path: grimsel.zurich.ibm.com!usenet
  2. From: wgk@zurich.ibm.com (Keith Whittingham)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Zeroing out a css
  5. Date: 2 Apr 1996 07:31:36 GMT
  6. Organization: IBM Research, ZRH
  7. Message-ID: <4jql4o$11p1@grimsel.zurich.ibm.com>
  8. References: <4jovdj$3mb@istwok.ods.com>
  9. Reply-To: wgk@zurich.ibm.com
  10. NNTP-Posting-Host: pine.zurich.ibm.com
  11. X-Newsreader: IBM NewsReader/2 v1.00
  12.  
  13. >I am curious what the implications of the following code snipet would be...?
  14. >x::x()
  15. >{
  16. >   memset(this, 0x0, sizeof(x));
  17. >}
  18. >
  19.  
  20. Implementation dependant as it depends how the compiler implements a class.
  21. It also, of course depends on what your class contains. It's a shame that
  22. this isn't valid code or that the C++ spec defined that all class members
  23. were init'd to 0 - (i.e. calloc was called by new instead of malloc) 
  24. it would probably have saved millions of lines of code and lord knows how
  25. many clock cycles...
  26.  
  27. Keith
  28.  
  29.  
  30.